accountingIntegrationDashboardApp.controller('maintenanceOperationCtrl', ['$scope', '$http', '$log', 'serverDataService', 'commonValidationService', function ($scope, $http, $log, serverDataService, commonValidationService){ 

    $scope.entityName = 'operation';

    $scope.setChildScope($scope);

    $scope.renderRecordsFromServer();

    $scope.addOperation = function() {
        $scope.inserted = {
          id: null,
          code: null,
          description: null,
          priority: null
        };
        $scope.gridRecords.push($scope.inserted);
    };

    $scope.validatePriority = function (columnName, data){
        if (data && data.trim().length > 0) {
            msg = commonValidationService.checkNumbersOnly(columnName, data);

            if (msg) {
                return msg;
            }
        }
    };
}]);